Socket
Socket
Sign inDemoInstall

@styled-system/css

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@styled-system/css

Styled System for the `css` prop


Version published
Weekly downloads
502K
decreased by-2.29%
Maintainers
1
Weekly downloads
 
Created

What is @styled-system/css?

@styled-system/css is a utility function for creating style objects based on a theme. It allows you to use a JavaScript object to define styles, which can then be applied to components. This package is part of the Styled System family and is designed to work seamlessly with other Styled System utilities.

What are @styled-system/css's main functionalities?

Theming

Theming allows you to define a set of design tokens (e.g., colors, spacing, typography) that can be referenced throughout your application. This ensures consistency and makes it easy to update the design system.

{
  "theme": {
    "colors": {
      "primary": "#07c",
      "secondary": "#05a"
    }
  },
  "styles": {
    "button": {
      "backgroundColor": "primary",
      "color": "white",
      "padding": "8px 16px",
      "borderRadius": "4px"
    }
  }
}

Responsive Styles

Responsive styles allow you to define different styles for different screen sizes using an array syntax. This makes it easy to create responsive designs without writing media queries.

{
  "styles": {
    "button": {
      "padding": ["8px 16px", "12px 24px", "16px 32px"]
    }
  }
}

Variant Styles

Variant styles allow you to define reusable style objects that can be applied to components. This is useful for creating consistent styles for different variants of a component (e.g., primary and secondary buttons).

{
  "theme": {
    "buttons": {
      "primary": {
        "backgroundColor": "primary",
        "color": "white"
      },
      "secondary": {
        "backgroundColor": "secondary",
        "color": "white"
      }
    }
  },
  "styles": {
    "button": {
      "variant": "buttons.primary"
    }
  }
}

Other packages similar to @styled-system/css

Keywords

FAQs

Package last updated on 17 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc